.class abstract Lnbisdk/hy;
.super Ljava/lang/Object;

# interfaces
.implements Lnbisdk/kg;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lnbisdk/hy$b;,
        Lnbisdk/hy$a;
    }
.end annotation


# instance fields
.field private dJ:Landroid/content/Context;

.field protected lj:Ljava/net/Socket;


# direct methods
.method public constructor <init>(Lnbisdk/sl;Landroid/content/Context;)V
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Ljava/lang/SecurityException;
        }
    .end annotation

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p2, p0, Lnbisdk/hy;->dJ:Landroid/content/Context;

    invoke-virtual {p0, p1}, Lnbisdk/hy;->a(Lnbisdk/sl;)V

    return-void
.end method


# virtual methods
.method protected abstract a(Lnbisdk/sl;)V
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Ljava/lang/SecurityException;
        }
    .end annotation
.end method

.method public close()V
    .locals 1

    :try_start_0
    iget-object v0, p0, Lnbisdk/hy;->lj:Ljava/net/Socket;

    invoke-virtual {v0}, Ljava/net/Socket;->close()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_0
.end method

.method protected final gk()V
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v5, 0x0

    iget-object v0, p0, Lnbisdk/hy;->dJ:Landroid/content/Context;

    if-nez v0, :cond_1

    :cond_0
    return-void

    :cond_1
    iget-object v0, p0, Lnbisdk/hy;->dJ:Landroid/content/Context;

    const-string v1, "connectivity"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Landroid/net/ConnectivityManager;

    invoke-virtual {p0}, Landroid/net/ConnectivityManager;->getAllNetworkInfo()[Landroid/net/NetworkInfo;

    move-result-object v0

    if-eqz v0, :cond_5

    array-length v1, v0

    move v2, v5

    move v3, v5

    :goto_0
    if-ge v2, v1, :cond_4

    aget-object v4, v0, v2

    if-nez v3, :cond_2

    invoke-virtual {v4}, Landroid/net/NetworkInfo;->isConnected()Z

    move-result v3

    if-eqz v3, :cond_3

    :cond_2
    const/4 v3, 0x1

    :goto_1
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :cond_3
    move v3, v5

    goto :goto_1

    :cond_4
    move v0, v3

    :goto_2
    if-nez v0, :cond_0

    new-instance v0, Ljava/net/UnknownHostException;

    const-string v1, "No network available"

    invoke-direct {v0, v1}, Ljava/net/UnknownHostException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_5
    move v0, v5

    goto :goto_2
.end method

.method public w()Ljava/io/OutputStream;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    new-instance v0, Lnbisdk/hy$a;

    iget-object v1, p0, Lnbisdk/hy;->lj:Ljava/net/Socket;

    invoke-virtual {v1}, Ljava/net/Socket;->getOutputStream()Ljava/io/OutputStream;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lnbisdk/hy$a;-><init>(Lnbisdk/hy;Ljava/io/OutputStream;)V

    return-object v0
.end method

.method public x()Ljava/io/InputStream;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    new-instance v0, Lnbisdk/hy$b;

    iget-object v1, p0, Lnbisdk/hy;->lj:Ljava/net/Socket;

    invoke-virtual {v1}, Ljava/net/Socket;->getInputStream()Ljava/io/InputStream;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Lnbisdk/hy$b;-><init>(Lnbisdk/hy;Ljava/io/InputStream;)V

    return-object v0
.end method
